<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 类的主要作用：提供了一个模板，通过new关键字可以在内存中根据这个模板创建对象实例，实现复用
        // 场景：人类有一个统一的能力：吃，Eat() 
        class Person {
            constructor(name,type){
                this.name = name;               
           }
            Eat(){
                console.log('吃的行为');
                }
        }

        class CPerson extends Person {
           constructor(name,type){
                super(name);
                this.type = type;
           }
           Eat(){
                console.log('优雅的吃');
                }
        }

        class EPerson extends Person {
           constructor(name){
              this.name = name;
           }
           Eat(){
                console.log('粗暴的吃');
                }
        }

        let cp = new CPerson('中国人','黄皮肤','','','','')
        let jp = new EPerson('英国人','白皮肤','','','','');

    </script>
</head>
<body>
    
</body>
</html>